import { createRouter, createWebHistory } from 'vue-router'
import AppLayout from '@/components/layout/AppLayout.vue'
import IndexView from '@/views/IndexView.vue'
import MenuIndex from '@/views/menu/MenuIndex.vue'
//  '../views/IndexView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'AppLayout',
      component: AppLayout,
      children:[
        {path: '',name: 'IndexView',component: IndexView},
        // {path: '',name: 'IndexView',component: IndexView},
        {path: '/menus',name: 'menus',component: MenuIndex},
        {path:'/menus/create',name:'menus-create',component:()=>import('../views/menu/CreateOrEdit.vue')},
        {path:'/menus/:id/edit',name:'menus-edit',component:()=>import('../views/menu/CreateOrEdit.vue')},
        {path: '/about',name: 'about',component: () => import('../views/AboutView.vue')},
        {path: '/:xxx(.*)*',name: 'NotFound',component: () => import('../views/NotFound.vue')},
      ]
    }
    
  ]
})

export default router
